package com.app.mycomposedemo.ui.screens


import android.annotation.SuppressLint
import androidx.compose.material.Scaffold
import androidx.compose.runtime.*
import androidx.compose.ui.tooling.preview.Preview
import com.app.mycomposedemo.ui.components.BottomNavigationComp
import com.app.mycomposedemo.viewmodel.MainViewModel

@SuppressLint("UnusedMaterialScaffoldPaddingParameter")
@Composable
fun MainFrame() {

    var currentNavigationIndex by remember {
        mutableStateOf(0)
    }

    Scaffold(
        bottomBar = {
            BottomNavigationComp(currentNavigationIndex) { index -> currentNavigationIndex = index }
        }
    ) {
        when(currentNavigationIndex) {
            0 -> StudyScreen(MainViewModel())
            1 -> TaskScreen()
            2 -> MineScreen()
        }
    }
}

@Preview(showSystemUi = true)
@Composable
fun MainFramePreview() {
    MainFrame()
}

